package com.cy.storage.controller;

import com.cy.storage.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

@RestController
public class StorageController {

    @Autowired
    private StorageService storageService;

    @GetMapping("/decrease") // localhost:8082/decrease?productId=1&count=10
    public String decrease(Long productId, Integer count){
        storageService.decrease(productId,count);
        return "用户扣减库存成功";
    }
}
